import request from '@/utils/request'
// 查询顶层业务组织机构列表
export const getTreeListApi = (params) =>
  request.get('/core/security/biz-organization/manager/list', { params })

// 查询顶层业务组织机构列表
export const getTreeChildListApi = (params) =>
  request.get('/core/security/biz-organization/child/list', { params })

// 查询当前用户可授权角色层级树
export const getPermissionsTreeApi = (params) =>
  request.get('/core/security/user/grant-role/tree', { params })

// 查询当前企业权限
export const getPermissionsListApi = (params) =>
  request.get('/core/security/grant-role-id/list', { params })

// 授权
export const setPermissionsApi = (data) =>
  request.post('/core/security/organization/grant-role', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })

// 回收权限
export const delPermissionsApi = (data) =>
  request.post('/core/security/organization/revoke-role', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
